package houseHold;

import java.util.Vector;

public enum RoomType {
	BATHROOM, BEDROOM, HALLWAY, KITCHEN, LIVINGROOM, ROOM;
	public static RoomType select(String type) {
		for (RoomType r : RoomType.values()) {
			if (r.toString().equalsIgnoreCase(type))
				return r;
		}
		return ROOM;
	}

	public static Vector<String> toList() {
		Vector<String> list = new Vector<String>();
		for (RoomType r : RoomType.values()) {
			if (r != RoomType.ROOM)
				list.add(r.toString());
		}
		return list;
	}

	public RoomType getRoom(String s) {
		for (RoomType r : RoomType.values()) {
			if (r.toString().equalsIgnoreCase(s))
				return r;
		}
		return null;
	}

	@Override
	public String toString() {
		switch (this) {
		case BATHROOM:
			return "Bathroom";
		case BEDROOM:
			return "Bedroom";
		case LIVINGROOM:
			return "Livingroom";
		case KITCHEN:
			return "Kitchen";
		case HALLWAY:
			return "Hallway";
		default:
			return "RoomType";
		}
	}
}
